﻿<Window x:Class="DaphneProfi.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:ignore="http://www.ignore.com"
        mc:Ignorable="d ignore"
        xmlns:ctrl = "clr-namespace:DaphneControls;assembly=DaphneControls"
        xmlns:loc="http://schemas.tomer.com/winfx/2006/xaml/presentation"
        xmlns:service="clr-namespace:MVVMDialogs;assembly=MVVMDialog"       
        service:DialogService.IsRegisteredView="True"
        Height="768"
        Width="1024"
        Title="Daphne Checkers Studio"
        WindowStartupLocation="CenterScreen"
        xmlns:avalonDock="http://avalondock.codeplex.com"
        DataContext="{Binding Main, Source={StaticResource Locator}}">
    
    
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Skins/MainSkin.xaml" />
            </ResourceDictionary.MergedDictionaries>                       
        </ResourceDictionary>
    </Window.Resources>

    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="45" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        
        <!-- The Main Menu-->
        <Menu Grid.Row="0">
            <MenuItem loc:Translate.Uid="MN_Game" Header="{loc:Translate}">
                <MenuItem loc:Translate.Uid="MN_NewGame" Header="{loc:Translate}" Command="{Binding Path=NewGameCommand}"/>
            </MenuItem>
            <MenuItem loc:Translate.Uid="MN_PDN" Header="{loc:Translate}">
                <MenuItem loc:Translate.Uid="MN_PDNLoad" Header="{loc:Translate}" Command="{Binding Path=LoadPDNCommand}" />
                <MenuItem loc:Translate.Uid="MN_PDNSave" Header="{loc:Translate}" Command="{Binding Path=SavePDNCommand}" />
                <Separator />
                <MenuItem loc:Translate.Uid="MN_PDNGameList" Header="{loc:Translate}" Command="{Binding Path=ShowPDNGameListCommand}" />
            </MenuItem>
            <MenuItem loc:Translate.Uid="MN_Position" Header="{loc:Translate}">
                <MenuItem loc:Translate.Uid="MN_StartEditMode" Header="{loc:Translate}" Command="{Binding Path=StartEditModeCommand}" />
            </MenuItem>
            
            <MenuItem Header="{loc:Translate Default='Engines'}">
                <MenuItem Header="{loc:Translate Default='Run Engine Match'}" Command="{Binding Path=RunEngineMatchCommand}" />
                <MenuItem Header="{loc:Translate Default='Manage CheckersBoard Engines'}" Command="{Binding Path=ManageCBEngineCommand}" />
            </MenuItem>
            
            <MenuItem loc:Translate.Uid="MN_View" Header="{loc:Translate}">
                <MenuItem loc:Translate.Uid="MN_Game" Header="{loc:Translate}" Command="{Binding Path=ShowGamePanel}"/>
                <MenuItem loc:Translate.Uid="MN_Tablebases" Header="{loc:Translate}" Command="{Binding Path=ShowTablebasesPanel}"/>
                <MenuItem loc:Translate.Uid="MN_GameLibrary" Header="{loc:Translate}" Command="{Binding Path=ShowGameLibraryPanel}"/>
                <MenuItem loc:Translate.Uid="MN_EngineOutput" Header="{loc:Translate}" Command="{Binding Path=ShowEngineOutputPanel}" />
                <MenuItem loc:Translate.Uid="MN_MatchOutput" Header="{loc:Translate}" Command="{Binding Path=ShowEngineMatchOutputPanel}" />
                <MenuItem loc:Translate.Uid="MN_Editor" Header="{loc:Translate}" Command="{Binding Path=ShowEditorPanel}" />
            </MenuItem>
            
            <MenuItem loc:Translate.Uid="MN_Language" Header="{loc:Translate}">
                <MenuItem Header="Česky" Command="{Binding Path=SetCzech}" />
                <MenuItem Header="English" Command="{Binding Path=SetEnglish}" />
            </MenuItem>           
            
            <MenuItem loc:Translate.Uid="MN_About" Header="{loc:Translate}">
                <MenuItem loc:Translate.Uid="MN_Licenses" Header="{loc:Translate}" Command="{Binding Path=ShowLibraryInfoCommand}" />
                
            </MenuItem>
        </Menu>       
        
        <!-- The main application toolbar -->
        <ToolBar Grid.Row="1">
            <ToolBarPanel Orientation="Horizontal">
                <Button Margin="3" Command="{Binding Path=NewGameCommand}">
                    <Image Source="AppData/Pictures/new_game.png" />
                </Button>
                <Button Margin="3" Command="{Binding Path=LoadPDNCommand}">
                    <Image Source="AppData/Pictures/load_game.png" />
                </Button>
                <Button Margin="3" Command="{Binding Path=SavePDNCommand}">
                    <Image Source="AppData/Pictures/save_game.png" />
                </Button>
                <Separator />
                <Button Margin="3" Command="{Binding Path=ReplayGameCommand}">Replay</Button>
                <Button Margin="3" Command="{Binding Path=RotateBoardCommand}">
                    <Image Source="AppData/Pictures/butt_rotate.png" />
                </Button>
                <Button Margin="3" Command="{Binding Path=SwitchPlayerModeCommand}">
                    <Image Source="AppData/Pictures/butt_1-2.png" />
                </Button>
                <Button Margin="3" Command="{Binding Path=StartEditModeCommand}" >
                    <Image Source="AppData/Pictures/butt_editor.png" />
                </Button>
                <Button Margin="3" Command="{Binding Path=AdviceMoveCommand}">
                    <Image Source="AppData/Pictures/butt_help.png" />
                </Button>
                <Button Margin="3" Command="{Binding Path=MoveNowCommand}">Move now</Button>
            </ToolBarPanel>
            
        </ToolBar>
                
        <!-- The content of the window -->
        <avalonDock:DockingManager Grid.Row="2" x:Name="uxDockingManager" >
            <avalonDock:DockingManager.Theme>
                <avalonDock:AeroTheme/>
            </avalonDock:DockingManager.Theme>
            <avalonDock:LayoutRoot>
                <avalonDock:LayoutPanel Orientation="Vertical">
                    <avalonDock:LayoutPanel Orientation="Horizontal">
                        <avalonDock:LayoutDocumentPane>
                        </avalonDock:LayoutDocumentPane>
                        <avalonDock:LayoutAnchorablePane DockWidth="400" >
                            <avalonDock:LayoutAnchorable x:Name="panelGame" CanClose="False" >
                                <ctrl:GameControl />
                            </avalonDock:LayoutAnchorable>
                            <avalonDock:LayoutAnchorable x:Name="panelEditor" CanClose="False">
                                <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                                    <ctrl:PositionEditor />
                                </ScrollViewer>
                            </avalonDock:LayoutAnchorable>
                            <avalonDock:LayoutAnchorable x:Name="panelMatchOutput" CanClose="False">
                                <ctrl:EngineMatchOutput />
                            </avalonDock:LayoutAnchorable>
                            <avalonDock:LayoutAnchorable x:Name="panelTablebases" CanClose="False" >
                            </avalonDock:LayoutAnchorable>
                            <avalonDock:LayoutAnchorable x:Name="panelGameList" CanClose="False" >                                
                                <ctrl:GameLibraryControl />
                            </avalonDock:LayoutAnchorable>
                    </avalonDock:LayoutAnchorablePane>
                    </avalonDock:LayoutPanel>
                    <avalonDock:LayoutAnchorablePane DockHeight="150" >
                        <avalonDock:LayoutAnchorable x:Name="panelEngineOutput" CanClose="False" >                           
                        </avalonDock:LayoutAnchorable>
                    </avalonDock:LayoutAnchorablePane>
                </avalonDock:LayoutPanel>               
            </avalonDock:LayoutRoot>           
        </avalonDock:DockingManager>
        
    </Grid>
</Window>
